package com.xuelongjiang.mqdemo;

import com.xuelongjiang.domain.Orders;
import com.xuelongjiang.mqdemo.mq.HelloSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xuelongjiang
 */
@RestController
@RequestMapping("mqtest")
public class MQTestController {

    @Autowired
    private HelloSender helloSender;


    @RequestMapping("/send")
    public void send(@RequestParam("mess") String message){
        helloSender.send(message);
    }

    @RequestMapping("/sendOrder")
    public void sendOrder(@RequestBody Orders orders){

        helloSender.sendOrders(orders);
    }

}
